import { OnInit, Component, ViewChild } from '@angular/core';
import { UserListComponent } from './user-list.component';

@Component({
  selector: 'app-user-view',
  templateUrl: './user-view.component.html',
  styles: [],
})
export class UserViewComponent implements OnInit {
  constructor() {}

  @ViewChild('userListComponent', { static: false })
  userListComponent: UserListComponent;

  /**
   * 条件查询参数
   */
  queryParams = {
    username: null,
    role: null,
  };

  /**
   * 刷新
   */
  reflesh() {
    this.userListComponent.loadData();
  }

  /**
   * 查询
   */
  onSearch() {
    this.userListComponent.loadData();
  }

  /**
   * 重置表单
   */
  onResetForm() {
    this.queryParams.username = null;
    this.queryParams.role = null;
  }

  create() {
    this.userListComponent.create();
  }
  ngOnInit() {}
}
